<template>
  <div class="car">
     <Header>
      <template slot="left">
        <p>
          <svg-icon iconClass="back" @click="$router.push('/layout/home')" />
        </p>
      </template>
      <template slot="center">
        <p>商品列表</p>
      </template>
      <template slot="right">
        <p></p>
      </template>
    </Header>
    <div class="main">
      <dl v-for="item in list" :key="item.id" @click="todetail(item.id)">
        <dt>
          <img src="@/img/1.png" alt="" style="width: 90px; height: 90px" />
        </dt>
        <dd>
          <p>{{ item.title }}...</p>

          <b class="bb">七天无理由退货</b>
          <p class="bbb">￥{{ item.price }}</p>
        </dd>
      </dl>
    </div>
  </div>
</template>

<script>
export default {
  created() {
    this.$store.dispatch("set_carlist");
  },
  methods: {
    todetail(id) {
      this.$router.push(`/detail/${id}`);
    },
  },
  computed: {
    list() {
      return this.$store.state.list;
    },
  },
};
</script>
 
<style lang="scss" scoped>
@import "@css/style.scss";
html {
  width: 100%;
  height: 100%;
}
body {
  width: 100%;
  height: 100%;
}
#app {
  width: 100%;
  height: 100%;
}
.car {
  width: 100%;
  height: 100%;
  /*  background: blanchedalmond; */
}
.top {
  width: 100%;
  height: 50px;
  position: sticky;
  top: 0;
  left: 0;
  background: #fff;
  font-size: px2rem(17);
  line-height: 48px;
  display: flex;
  border: 1px solid #ccc;
  b {
    margin-left: 130px;
  }
}
.main {
  width: 100%;

  dl {
    display: flex;
    width: 100%;
    height: 100%;
    margin-top: px2rem(4);
    border-bottom: 1px solid #ccc;

    dt {
      width: 30%;
      height: 100%;
      margin-top: px2rem(10);
    }
    dd {
      width: 70%;
      font-size: px2rem(15);
      height: 100%;
      font-size: px2rem(13);
      margin-top: px2rem(10);
    }
    .bbb {
      color: red;
      font-size: 18px;
    }
  }
  button {
    margin-left: 170px;
    width: px2rem(70);
    font-size: px2rem(10);
    height: px2rem(22);
    background: red;
    margin-bottom: px2rem(5);

    border: none;
    border-radius: px2rem(10);
    color: #fff;
  }
  .bb {
    color: orange;
  }
}
</style>